package com.yuanqi.dz.dc.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class ReadProperPre {
private static Properties p = null;
	
	public static String getProperties(String key){
		if(p != null){
			return p.getProperty(key);
		}
		InputStream input = null;
		String message = null;
		try {
			input = ReadProperPre.class.getClassLoader().getResourceAsStream("powerpre.ini");
			p = new Properties();
			p.load(input);
			message = p.getProperty(key);
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			if(input != null)
				try {
					input.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
		}
		return message;
	}
	
	
	public static void main(String[] args) {
		System.out.println(getProperties("debug"));
	}
	
	
	
}
